package edu.sctu.zhengsenwen.month201506.day20150614.textthreadutil;

import javax.swing.*;
import java.awt.event.WindowEvent;

/**
 * Created by user15 on 2015/6/14.
 */
public class ImplementsRunnable extends JFrame{

    JPanel contentPane = new JPanel();

    ClockLabel label1 = new ClockLabel();

    public ImplementsRunnable(){

        try{
            jbInit();
        }catch (Exception ex){}
    }


    public static void main(String[] args) {

        ImplementsRunnable frame = new ImplementsRunnable();

        frame.setVisible(true);
    }



    private void jbInit(){

        contentPane = (JPanel) this.getContentPane();

        this.setTitle("Runnable接口的示例");

        this.setSize(270,70);

        label1.setHorizontalAlignment(label1.CENTER);

        contentPane.add(label1);




        this.addWindowListener(new java.awt.event.WindowAdapter(){

                public void windowClosing(WindowEvent e ){

            System.exit(0);

        }
    });
    }

}



